<?php
include __DIR__ . '/../vendor/autoload.php';
$header = ['name', 'age', 'score'];
$data = [
    ['张飞', '48', '64'],
    ['关羽', '49', '68'],
    ['刘备', '51', '60'],
];
$export = (new \Aug\Tools\Exporter\Exporter(['file' => 'test.csv']))
    ->setIsZip(true)
    ->addRow($header);
foreach ($data as $row) {
    $export->addRow($row);
}
$export->output();

// $fp = fopen('php://memory', 'r+');
// fputcsv($fp, ['name', 'age']);
// fputcsv($fp, ['Lucy', '12']);
// rewind($fp);
// $res = stream_get_contents($fp);
// print_r($res);
// die;